﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Transportation : System.Web.UI.Page
{
    Connectdbnour con = new Connectdbnour();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                con.S1TOS2LENS(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                con.S1TOS2LENS(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {            
            Label1.Text=ex.Message;
        }        
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                con.S2TOS1LENS(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                con.S2TOS1LENS(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }        
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                Label1.Text = con.insertlenss1(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                Label1.Text = con.insertlenss1(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }        
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                Label1.Text = con.insertlenss2(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                Label1.Text = con.insertlenss2(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }        
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                con.dels1lens(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                con.dels1lens(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }        
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadioButtonList1.SelectedItem.ToString() == "Lens")
            {
                con.dels2lens(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), 1, Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
            else if (RadioButtonList1.SelectedItem.ToString() == "Box")
            {
                con.dels2lens(DropDownList1.SelectedItem.ToString(), DropDownList2.SelectedItem.ToString(), DropDownList3.SelectedItem.ToString(), Convert.ToInt16(DropDownList4.SelectedItem.ToString()), Convert.ToDouble(DropDownList5.SelectedItem.ToString()), Convert.ToDouble(DropDownList6.SelectedItem.ToString()), Convert.ToDouble(DropDownList7.SelectedItem.ToString()), Convert.ToDouble(DropDownList8.SelectedItem.ToString()), Convert.ToDouble(DropDownList9.SelectedItem.ToString()), Convert.ToInt16(TextBox1.Text));
            }
        }
        catch (Exception ex)
        {
            Label1.Text = ex.Message;
        }        
    }
    protected void Button7_Click(object sender, EventArgs e)
    {
        try
        {
            con.S1TOS2soln(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button8_Click(object sender, EventArgs e)
    {
        try
        {
            con.S2TOS1soln(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button9_Click(object sender, EventArgs e)
    {
        try
        {
            Label2.Text = con.insertsolns1(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button10_Click(object sender, EventArgs e)
    {
        try
        {
            Label2.Text = con.insertsolns2(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button11_Click(object sender, EventArgs e)
    {
        try
        {
            con.dels1soln(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button12_Click(object sender, EventArgs e)
    {
        try
        {
            con.dels2soln(DropDownList10.SelectedItem.ToString(), Convert.ToInt16(DropDownList11.SelectedItem.ToString()), Convert.ToInt16(TextBox2.Text));
        }
        catch (Exception ex)
        {
            Label2.Text = ex.Message;
        }
    }
    protected void Button13_Click(object sender, EventArgs e)
    {
        try
        {
            con.S1TOS2accs(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void Button14_Click(object sender, EventArgs e)
    {
        try
        {
            con.S2TOS1accs(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void Button15_Click(object sender, EventArgs e)
    {
        try
        {
            Label3.Text = con.insertaccss1(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void Button16_Click(object sender, EventArgs e)
    {
        try
        {
            Label3.Text = con.insertaccss2(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void Button17_Click(object sender, EventArgs e)
    {
        try
        {
            con.dels1accs(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void Button18_Click(object sender, EventArgs e)
    {
        try
        {
            con.dels2accs(DropDownList12.SelectedItem.ToString(), Convert.ToInt16(TextBox3.Text));
        }
        catch (Exception ex)
        {
            Label3.Text = ex.Message;
        }
    }
    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedItem.ToString() == "Box")
        {
            DropDownList4.Enabled = true;
        }
        else if (RadioButtonList1.SelectedItem.ToString() == "Lens")
        {
            DropDownList4.Enabled = false;
        }
    }
}